﻿using System.Windows;

namespace Waaahsabi.Controls.TheGame
{
	[TemplateVisualState(GroupName = "Default", Name = "Idle")]
	[TemplateVisualState(GroupName = "Default", Name = "GoodHit")]
	[TemplateVisualState(GroupName = "Default", Name = "BadHit")]
	public class BypasserControl : GenericTargetingControl
	{
		//#region Label DependencyProperty
		//public static readonly DependencyProperty LabelProperty =
		//DependencyProperty.Register
		//    (
		//    "Label",
		//    typeof(string),
		//    typeof(BypasserControl),
		//    new PropertyMetadata("NoName")
		//    );

		//public string Label
		//{
		//    get { return (string)GetValue(LabelProperty); }
		//    set { SetValue(LabelProperty, value); }
		//}
		//#endregion
		//#region StatusText DependencyProperty
		//public static readonly DependencyProperty StatusTextProperty =
		//DependencyProperty.Register
		//    (
		//    "StatusText",
		//    typeof(string),
		//    typeof(BypasserControl),
		//    new PropertyMetadata(null)
		//    );

		//public string StatusText
		//{
		//    get { return (string)GetValue(StatusTextProperty); }
		//    set { SetValue(StatusTextProperty, value); }
		//}
		//#endregion

		//private bool IsDragging;
		//private Storyboard ProgressAnimation;
		//private Storyboard ReverseProgressAnimation;
		//private Button btnQuitButton;

		//public new event EventHandler<MouseEventArgs> ControlMoving;
		//public new event EventHandler<MouseButtonEventArgs> Drop;
		//public new event RoutedEventHandler QuitButtonClick;
		//public new event EventHandler AnimationCompleted;
		//private Point dragStartPoint;
		public BypasserControl()
		{
			DefaultStyleKey = typeof(BypasserControl);
		}

		//public override void OnApplyTemplate()
		//{
		//    base.OnApplyTemplate();
		//    ProgressAnimation = GetTemplateChild("ProgressAnimation") as Storyboard;
		//    ReverseProgressAnimation = GetTemplateChild("ReverseProgressAnimation") as Storyboard;
		//    btnQuitButton = GetTemplateChild("btnQuitButton") as Button;
		//    if(btnQuitButton != null)
		//    {
		//        btnQuitButton.Click += QuitButtonClick;
		//    }
		//}

		//protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
		//{
		//    base.OnMouseLeftButtonDown(e);
		//    dragStartPoint = e.GetPosition(null);
		//    IsDragging = true;
		//    CaptureMouse();
		//}

		//protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
		//{
		//    base.OnMouseLeftButtonUp(e);
		//    IsDragging = false;
		//    ReleaseMouseCapture();

		//    if(dragStartPoint == e.GetPosition(null))
		//        return;
		//    if (Drop != null)
		//        Drop(this, e);
		//}

		//protected override void OnMouseMove(MouseEventArgs e)
		//{
		//    base.OnMouseMove(e);
		//    if(IsDragging)
		//    {
		//        if (ControlMoving != null)
		//            ControlMoving(this, e);
		//        Point currentPosition = e.GetPosition(null);
		//        Canvas.SetLeft(this, currentPosition.X - 2);
		//        Canvas.SetTop(this, currentPosition.Y - RenderSize.Height + 2);
		//    }
		//}

		//public void ShowProgressAnimation(double speedMultiplier)
		//{
		//    ProgressAnimation.SpeedRatio = speedMultiplier;
		//    ProgressAnimation.Completed += AnimationCompleted;
		//    ProgressAnimation.Begin();
		//}

		//public void ShowReverseProgressAnimation(double speedMultiplier)
		//{
		//    ReverseProgressAnimation.SpeedRatio = speedMultiplier;
		//    ReverseProgressAnimation.Completed += AnimationCompleted;
		//    ReverseProgressAnimation.Begin();
		//}

		//public void InterruptAnimation()
		//{
		//    ProgressAnimation.Stop();
		//    ReverseProgressAnimation.Stop();
		//}

		//public void ClearAnimationEventHandlers()
		//{
		//    AnimationCompleted = null;
		//}
	}
}
